﻿namespace Shanda.DevFx.Security.Web
{
    using Shanda.DevFx.Config;
    using Shanda.DevFx.ExceptionManagement.Web;
    using System;
    using System.Xml.Serialization;

    [XmlRoot("appSettings")]
    public class AppSettings
    {
        [XmlElement("appTitle")]
        public string AppTitle;
        private static Shanda.DevFx.Security.Web.AppSettings instance;

        static AppSettings()
        {
            Shanda.DevFx.Security.Web.WebModule instance = Shanda.DevFx.Security.Web.WebModule.Instance;
            if (instance == null)
            {
                throw new Shanda.DevFx.ExceptionManagement.Web.PageException("WebModule没有被正确配置");
            }
            Shanda.DevFx.Security.Web.AppSettings.instance = (Shanda.DevFx.Security.Web.AppSettings) instance.Setting.ToObject(typeof(Shanda.DevFx.Security.Web.AppSettings));
        }

        public static Shanda.DevFx.Security.Web.AppSettings Instance
        {
            get
            {
                return instance;
            }
        }

        [XmlIgnore]
        public IConfigSetting Setting
        {
            get
            {
                return Shanda.DevFx.Security.Web.WebModule.Instance.Setting;
            }
        }
    }
}

